package com.weixin1.service;

import com.weixin1.bean.Users;
import com.weixin1.dao.UserDao;

import java.sql.SQLException;
import java.util.List;

public class UserService {
    UserDao dao=new UserDao();
    public List<Users> list() throws SQLException {
        return dao.list();
    }
    public Users getById(Long id) throws SQLException {
        return  dao.getById(id);
    }
    public  boolean save(Users user) throws SQLException {
        return dao.save(user)>0;
    }
    public boolean removeById(Long id) throws SQLException {
        return dao.removeById(id)>0;
    }
    public boolean update(Users user) throws SQLException {
        return dao.update(user)>0;
    }
    //获取用户个数
    public long unamecount() throws SQLException {
        return dao.unamecount();
    }
    //获取留言个数
    public long umessagecount() throws SQLException {
        return dao.umessagecount();
    }
    //获取预约个数
    public long utime() throws SQLException {
        return dao.utime();
    }
    //分页查询
    public List<Users> selectByPage(int page,int limit) throws SQLException {
        return dao.selectBypage(page,limit);
    }
    //获取数据的长度
    public int gettotal() throws SQLException {
        return dao.gettotal();
    }

    public List<Users> selectContent() throws SQLException {
        return dao.selectContent();
    }
}
